Repository navigation
fix: tool_choice 指定 web_search 等服务端工具时开启对应的 Google 工具 - #214
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #212
tool_choice: {"type":"tool","name":"web_search"}指定web_search_20250305时,服务返回 400 “tool choice references undeclared function "web_search"”。tool的tool_choice一律按客户端函数处理,web_search是 server tool,转成 Google 搜索后不在函数声明中,于是被当作未声明的函数拒绝。tool_choice指定web_search、web_fetch、code_execution等 server tool 时,本次只开启对应的 Google 工具并要求模型使用它,不再放进允许调用的函数名单。